<?php
include 'includes.php';


if (isset($_SESSION['user']) && $_SESSION['user']['permisos'] == 'admin') {
    $raid = R::dispense('raid');
    
$raid->nombre = $_POST['nombre'];
$raid->prioridad = $_POST['prioridad'];

echo $_POST['nombre'];

for($i = 1;$i <= $_POST['tamano'];$i++) {
    
    $boss = R::dispense('bosses');
    $boss->nombre = $_POST[(string)$i];
    $raid->ownBossList[]=$boss;
    
}
R::store($raid);
    
}


error_reporting(E_ALL);
$host3 = $_SERVER['HTTP_HOST'];
$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
$extra = 'adminraid.php';
header("Location: http://" . $host3 . $uri . "/" . $extra);
die();

?>
